home *** CD-ROM | disk | FTP | other *** search
- /*
- ##########################################################################
- #### ####
- #### The MusicBox Project ####
- #### ============================ ####
- #### ####
- #### MusicBoxTimer.c ####
- #### ####
- #### Version 2.1os -- September 29, 2000 ####
- #### ####
- #### Copyright (C) 1994 Thomas Dreibholz ####
- #### 2000 Molbachweg 7 ####
- #### 51674 Wiehl ####
- #### Germany ####
- #### ####
- #### EMail: Dreibholz@bigfoot.com ####
- #### WWW: http://www.bigfoot.com/~dreibholz ####
- #### ####
- ##########################################################################
- */
- /***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-
- /* MusicBox Timer-Task */
-
- struct Task *MainTask;
- struct Task *TimerTask;
-
- extern ULONG ProcessSignalMask;
-
- UBYTE RemoveFlag;
-
- void NewProcess()
- {
- geta4();
-
- for(;;)
- {
- Signal(MainTask,ProcessSignalMask);
- Delay(5);
- if(RemoveFlag==1) break;
- }
- Forbid();
- RemoveFlag=2;
- Exit(0);
- }
-
- int InitProzess()
- {
- RemoveFlag=0;
- MainTask=FindTask(NULL);
- TimerTask=CreateProcess((APTR)NewProcess,1000,"musicbox-display.process",10);
- if(TimerTask==NULL) return(1);
- return(0);
- }
-
- void EntferneProzess()
- {
- REGISTER BOOL bool;
-
- if(TimerTask!=NULL)
- {
- Forbid();
- RemoveFlag=1;
- Permit();
- bool=FALSE;
- do
- {
- Delay(2);
- Forbid();
- if(RemoveFlag==2) bool=TRUE;
- Permit();
- } while(bool==FALSE);
- }
- }
-
-